var aaa = "aaa";

// var url = "http://www.mysign.com/index.php/sign/api/";
var url = "http://47.95.202.255:81/sign/api/";  


function jqueryHttp(url,cb){
    console.log("http qing qiu :" + url);
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
            var base =  xhr.responseText;
            var obj = JSON.parse(base);
            cb(obj);
        }else{
        	// cb(null,"error");
        }
    };
   
    xhr.open("GET", url, false);
    xhr.send();
};

var androidExit = function (event) {
    console.log(cc.KEY.back + "<---back KEY_DOWN:" + event.keyCode);
    switch (event.keyCode) {
        case cc.KEY.back:
            var ret = jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "showExitDialog", "(Ljava/lang/String;Ljava/lang/String;)V", "title", "hahahahha");
            break;
    }
};
function isnullOrundefined(obj){
	if(obj == null || obj == undefined || obj == "null"){
		return true;
	}
	return false;
};
function getDataByType(date,type){
    if(isnullOrundefined(date)){
        date = new Date();  
    }else{
        date = new Date(date*1000);
    }
    // var date = new Date(date*1000);//如果date为13位不需要乘1000
    var Y = date.getFullYear() + '-';
    var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
    var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());

    var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
    var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
    var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());
    

    return h+m+s;
};


